﻿using Archives.Entities;
using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Web;

namespace Archives.Mapping
{
    public class ORG_DepartmentMap : EntityTypeConfiguration<ORG_Department>
    {
        public ORG_DepartmentMap()
        {
            // Primary Key
            this.HasKey(t => t.DeptID);
            // Properties
            //                
            this.Property(t => t.DeptID)
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnName("DeptID");
            //                
            this.Property(t => t.DeptName)
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnName("DeptName");
            //                
            this.Property(t => t.DeptShortName)
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnName("DeptShortName");
            //                
            this.Property(t => t.DeptDescr)
                .IsRequired()
                .HasMaxLength(250)
                .HasColumnName("DeptDescr");
            //                
            this.Property(t => t.ParentID)
                .IsRequired()
                .HasMaxLength(50)
                .HasColumnName("ParentID");
            //                
            this.Property(t => t.CreateTime)
                .IsRequired()
                .HasColumnName("CreateTime");
            //                
            this.Property(t => t.UpdateTime)
                .IsRequired()
                .HasColumnName("UpdateTime");
            //                
            this.Property(t => t.DeptHierarchyCode)
                .HasMaxLength(50)
                .HasColumnName("DeptHierarchyCode");
            // Table & Column Mappings
            this.ToTable("ORG_Department");


        }
    }
}